package cn.buk.tms.entity.config;

import cn.buk.tms.entity.base.BaseInfo;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;

/**
 * 连接到eotms的接口配置参数
 */
@Entity
@Table(name = "ent_eotms_config", uniqueConstraints = @UniqueConstraint(name = "uk_ent_eotms_config",
        columnNames = {"enterprise_id", "app_id", "username"}))
public class EntEotmsConfig extends BaseInfo {

  /**
   * eotms应用id
   */
  @Column(name = "app_id", nullable = false, updatable = false)
  private String appId;

  /**
   * 用户名
   */
  @Column(name = "username", nullable = false, updatable = false)
  private String username;


  /**
   * 接口网关地址
   */
  private String gateway;

  /**
   * 接口应用密钥
   */
  @Column(name = "app_secret", length = 2048)
  private String appSecret;

  /**
   * 用户名对应的密码（md5加密存储）
   */
  @Column(name = "md5_password", length = 2048)
  private String md5Password;

  /**
   * 用户名username对应的明文密码
   */
  private String password;

  /**
   * 对应哪一个供应商id
   */
  @Column(name = "supplier_id")
  private Integer supplierId;

  /**
   * 航司限制, 只能看列出代码的航司
   * 航司2字代码，多个航司用逗号分隔
   */
  @Column(name = "airline_limit")
  private String airlineLimit;

  public int getSupplierId() {
    return supplierId == null ? 0 : supplierId;
  }

  public void setSupplierId(Integer supplierId) {
    this.supplierId = supplierId;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public String getMd5Password() {
    return md5Password;
  }

  public void setMd5Password(String md5Password) {
    this.md5Password = md5Password;
  }

  public String getAppSecret() {
    return appSecret;
  }

  public void setAppSecret(String appSecret) {
    this.appSecret = appSecret;
  }

  public String getGateway() {
    return gateway;
  }

  public void setGateway(String gateway) {
    this.gateway = gateway;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getAppId() {
    return appId;
  }

  public void setAppId(String appId) {
    this.appId = appId;
  }

  public String getAirlineLimit() {
    return airlineLimit;
  }

  public void setAirlineLimit(String airlineLimit) {
    this.airlineLimit = airlineLimit;
  }
}
